package com.lj.dict.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lj.dict.entity.Dict;
import com.lj.dict.param.DictPageParam;
import com.lj.dict.param.DictSaveParam;
import com.lj.dict.param.DictUpdateParam;
import com.lj.dict.result.DictInfoResult;
import com.lj.dict.result.DictItemResult;
import com.lj.dict.result.DictPageResult;
import com.lj.mp.standard.StandardService;

import java.util.List;

/**
 * <p>
 * 字典表 服务类
 * </p>
 *
 * @author luojing
 * @since 2025-01-10 11:07:47
 */
public interface DictService extends StandardService<Dict> {

    IPage<DictPageResult> page(DictPageParam param);

    DictInfoResult info(Long id);

    void save(DictSaveParam param);

    void update(DictUpdateParam param);

    default Dict getByType(String dictType) {
        return getOne(lambdaQueryWrapper()
                .eq(Dict::getDictType, dictType)
                .last("LIMIT 1"));
    }


    void delete(List<Long> ids);

    List<DictItemResult<Object>> getDictItemByName(String dictType);
}
